/**
 */
package gatperdut.chato.model.Chato.Item.impl;

import gatperdut.chato.model.Chato.Item.ItemPackage;
import gatperdut.chato.model.Chato.Item.ItemTemplate;
import gatperdut.chato.model.Chato.Item.TemplateBoxInventory;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

/**
 * <!-- begin-user-doc --> An implementation of the model object '
 * <em><b>Template</b></em>'. <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.ItemTemplateImpl#getInventory <em>Inventory</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ItemTemplateImpl extends GenericItemImpl implements ItemTemplate {
    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    protected ItemTemplateImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return ItemPackage.Literals.ITEM_TEMPLATE;
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public TemplateBoxInventory getInventory() {
        return (TemplateBoxInventory)eDynamicGet(ItemPackage.ITEM_TEMPLATE__INVENTORY, ItemPackage.Literals.ITEM_TEMPLATE__INVENTORY, true, true);
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetInventory( TemplateBoxInventory newInventory, NotificationChain msgs ) {
        msgs = eDynamicInverseAdd((InternalEObject)newInventory, ItemPackage.ITEM_TEMPLATE__INVENTORY, msgs);
        return msgs;
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public void setInventory( TemplateBoxInventory newInventory ) {
        eDynamicSet(ItemPackage.ITEM_TEMPLATE__INVENTORY, ItemPackage.Literals.ITEM_TEMPLATE__INVENTORY, newInventory);
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove( InternalEObject otherEnd, int featureID, NotificationChain msgs ) {
        switch (featureID) {
            case ItemPackage.ITEM_TEMPLATE__INVENTORY:
                return basicSetInventory(null, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet( int featureID, boolean resolve, boolean coreType ) {
        switch (featureID) {
            case ItemPackage.ITEM_TEMPLATE__INVENTORY:
                return getInventory();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eSet( int featureID, Object newValue ) {
        switch (featureID) {
            case ItemPackage.ITEM_TEMPLATE__INVENTORY:
                setInventory((TemplateBoxInventory)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset( int featureID ) {
        switch (featureID) {
            case ItemPackage.ITEM_TEMPLATE__INVENTORY:
                setInventory((TemplateBoxInventory)null);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet( int featureID ) {
        switch (featureID) {
            case ItemPackage.ITEM_TEMPLATE__INVENTORY:
                return getInventory() != null;
        }
        return super.eIsSet(featureID);
    }

} // ItemTemplateImpl
